package day09.HashMapTest;

import java.util.HashMap;

public class Test3 {
    public static void main(String[] args) {
        Student stu1 = new Student(1000,"张三","男", 9);
        Student stu2 = new Student(1000,"张三","男", 9);

        //hash值必须相同，才能保证保证同一个位置
        System.out.println(stu1.hashCode());
        System.out.println(stu2.hashCode());


        System.out.println(stu1.equals(stu2));

        HashMap<Student, Integer> map = new HashMap<>();
        map.put(stu1, 95);
        map.put(stu2, 90);
        System.out.println(map);
    }
}
